<template>
  <n-drawer v-model:show="active" width="84%">
    <n-drawer-content body-style="--n-body-padding:0">
      <div class="pay">
        <div class="pay_left">
          <p class="pay_left-title">充值金额</p>
          <div class="pay_left-radio">
            <button v-for="item in amountList" :key="item.id" class="pay_left-radio-item" :class="{ 'pay_left-radio-item--active' :  item.id === 1 }">
              <div class="pay_left-radio-item--active_icon iconfont icon-queding">
              </div>
              {{ item.value }}
            </button>
          </div>
          <p class="pay_left-title">赠送/金额积分</p>
          <div class="pay_left-give">
            <div class="pay_left-give-item">
              <div class="i-left">金额：</div>
              <div class="i-right">248元</div>
            </div>
            <div class="pay_left-give-item">
              <div class="i-left">积分：</div>
              <div class="i-right">2积分</div>
            </div>
          </div>
          <div class="pay_left-tip">
            <div class="t-title">
              <i class="t-title_icon iconfont icon-yiwenshuoming"></i>
              <span>说明：</span>
            </div>
            <p>充值成功后，充值金额及赠送金额累计到至尊钱包。</p>
            <p>可在【店铺系统后台】-【营销平台】-【活动套餐奖励设置】设置奖励积分, 赠送金额。</p>
          </div>
          <p class="pay_left-title">选择支付方式</p>
          <div class="pay_left-radio">
            <button class="pay_left-radio-item" :class="{ 'pay_left-radio-item--active' :  true}">
              <div class="pay_left-radio-item--active_icon iconfont icon-queding">
              </div>
              <span class="pay_left-radio-item--icon iconfont icon-weixinzhifu"></span>微信
            </button>
            <button class="pay_left-radio-item" :class="{ 'pay_left-radio-item--active' :  false}">
              <div class="pay_left-radio-item--active_icon iconfont icon-queding"></div>
              更多支付
            </button>
          </div>
          <p class="pay_left-title">选择操作员</p>
          <div class="pay_left-radio">
            <button class="pay_left-radio-item" :class="{ 'pay_left-radio-item--active' :  true}">
              <div class="pay_left-radio-item--active_icon iconfont icon-queding"></div>
              李建霞
            </button>
          </div>
        </div>
        <div class="pay_right">
          <div class="pay_right-card">
            <p>李建新 <span>13625482699</span></p>
            <p>会员类型：<span>至尊会员</span>
            </p>
          </div>
          <div class="pay_right-content">
            <div class="pay_right-content_item">
              <span>充值金额</span>
              <span>248元</span>
            </div>
            <div class="pay_right-content_item">
              <span>赠送金额</span>
              <span>248.00元</span>
            </div>
            <div class="pay_right-content_item">
              <span>赠送积分</span>
              <span>2积分</span>
            </div>
            <div class="pay_right-content_item">
              <span>应付金额</span>
              <span>248.00元</span>
            </div>
          </div>
          <div class="pay_right-footer">
            <button class="pay_right-footer_btn pay_right-footer_btn--cancel" @click="active=false">取消结算</button>
            <button class="pay_right-footer_btn pay_right-footer_btn--confirm">结算并打印</button>
          </div>
        </div>
      </div>
    </n-drawer-content>
  </n-drawer>
</template>

<script setup>
import { inject } from "vue";

const active = inject('toUpDrawerActive');
const amountList = [
  {
    id: 1,
    value: 1000
  },
  {
    id: 2,
    value: 2000
  },
  {
    id: 3,
    value: 3000
  },
  {
    id: 4,
    value: 5000
  },
  {
    id: 5,
    value: 6000
  },
  {
    id: 6,
    value: 8000
  },
  {
    id: 7,
    value: 10000
  },
  {
    id: 8,
    value: 20000
  }
]
</script>

<style lang="less" scoped>
.pay {
  display: flex;
  height: 100vh;

  &_left {
    flex: 1;
    padding: 0 30px;
    border-right: 1px solid #e5e5e5;

    &-title {
      position: relative;
      padding-left: 20px;
      margin: 20px 0;
      font-size: 22px;
      font-weight: 500;
      color: #4a5060;

      &::before {
        position: absolute;
        top: 6px;
        left: 0;
        content: "";
        width: 6px;
        height: 24px;
        background: #373b4f;
      }
    }
    &-give {
      display: flex;
      align-items: center;
      margin-bottom: 20px;

      &-item {
        display: flex;
        align-items: center;
        margin-right: 20px;
        font-size: 22px;
        border: 1px solid #e5e5e5;

        .i-left {
          width: 134px;
          height: 60px;
          color: #666;
          text-align: center;
          line-height: 60px;
          background: #FFF;
        }
        .i-right {
          width: 134px;
          height: 60px;
          color: #2E323D;
          text-align: center;
          line-height: 60px;
          background: #F8F8F8;
        }
      }
    }
    &-tip {
      width: 837px;
      height: 156px;
      padding: 20px;
      margin: 30px 0 60px;
      background: #fff7ec;
      border-radius: 4px;

      .t-title {
        display: flex;
        align-items: center;

        &_icon {
          margin-right: 10px;
          font-size: 32px;
          color: #fe9900;
        }

        > span {
          font-size: 22px;
          font-weight: 400;
          color: #4a5060;
        }
      }

      > p {
        position: relative;
        width: 747px;
        height: 53px;
        margin-left: 65px;
        font-size: 22px;
        font-weight: 500;
        color: #fe9900;
        line-height: 30px;

        &::before {
          position: absolute;
          left: -20px;
          top: 10px;
          content: "";
          width: 10px;
          height: 10px;
          background: #000;
          border-radius: 50%;
        }
      }
    }

    &-radio {
      display: flex;
      flex-wrap: wrap;
      width: 880px;

      &-item {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 158px;
        height: 60px;
        margin-right: 20px;
        margin-bottom: 20px;
        font-size: 24px;
        font-weight: 400;
        color: #4a5060;
        line-height: 60px;
        background: #f4f4f4;
        border: 2px solid #dddee2;
        border-radius: 4px;

        &:nth-child(5n) {
          margin-right: 0;
        }

        &--icon {
          margin-right: 10px;
          font-size: 30px;
          color: #09bb07;
        }

        &--active {
          position: relative;
          background: #e6f2ff;
          border: 1px solid #1981f4;

          &::after {
            position: absolute;
            top: 0;
            right: 0;
            content: "";
            width: 0;
            height: 0;
            border-top: 30px solid #1981f4;
            border-left: 30px solid transparent;
          }

          &_icon {
            position: absolute;
            top: -20px;
            right: 0;
            z-index: 99;
            font-size: 18px;
            color: #fff;
          }
        }
      }
    }
  }

  &_right {
    display: flex;
    flex-direction: column;
    width: 610px;
    padding: 30px;

    &-card {
      width: 570px;
      height: 78px;
      padding: 20px;
      background: #6d6e83;
      box-shadow: 0px 3px 8px 0px rgba(31, 31, 31, 0.4);
      border-radius: 4px;

      > p {
        &:nth-child(1) {
          margin-top: 10px;
          font-size: 36px;
          font-weight: bold;
          color: #fff;
          line-height: 18px;
          text-shadow: 0px 2px 10px rgba(0, 0, 0, 0.4);

          > span {
            margin-left: 10px;
          }
        }

        &:nth-child(2) {
          margin-top: 30px;
          font-size: 26px;
          font-weight: 400;
          color: #dddee2;
          line-height: 18px;

          > span {
            color: #fff;
          }
        }
      }
    }

    &-content {
      flex: 1;
      overflow-y: auto;

      &_item {
        display: flex;
        justify-content: space-between;
        align-items: center;
        height: 84px;
        font-size: 26px;
        font-weight: 500;
        color: #4a5060;
      }
    }

    &-footer {
      display: flex;
      justify-content: space-between;
      align-items: center;
      height: 68px;

      &_btn {
        width: 296px;
        height: 68px;
        font-size: 30px;
        font-weight: 500;
        text-align: center;
        line-height: 68px;
        border-radius: 4px;

        &--cancel {
          color: #4a5060;
          background: #f8f8f8;
          border: 1px solid #e5e5e5;
        }

        &--confirm {
          color: #fff;
          background: #1981f4;
          border-radius: 4px;
        }
      }
    }
  }
}
</style>